package com.test.flink_sinks;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class F01SinkPrint {

    public static void main(String[] args) throws Exception {
        Configuration configuration = new Configuration();
        configuration.setInteger("rest.port", 8888);
        StreamExecutionEnvironment webUI = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(configuration);

        DataStreamSource<String> data = webUI.socketTextStream("127.0.0.1", 9001);

        SingleOutputStreamOperator<String> ds = data.map(String::toUpperCase);
        ds.print("输出：");

        webUI.execute("我的打印测试");
    }
}
